home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / pchwpa8.lha / TestWPA8.S < prev   
Text File  |  1995-08-24  |  3KB  |  154 lines

  1. *** WritePixelArray8 test ***
  2.  
  3.     opt    c+,d+
  4.  
  5.     include    system.gs
  6. *    incdir    dh2:include/
  7.     include    dos/dos.i
  8.     include    dos/dos_lib.i
  9.     include    exec/exec_lib.i
  10.     include    intuition/intuition.i
  11.     include    intuition/intuition_lib.i
  12.     include    graphics/graphics_lib.i
  13.  
  14. ;-------------------------------------------------------
  15.  
  16.     section    test,code
  17.     
  18. start:    move.l    sp,oldstack
  19.  
  20.     bsr    gfxopen
  21.     bsr    intuiopen
  22.  
  23.     sub.l    a0,a0
  24.     lea    screentaglist(pc),a1
  25.     CALLINT OpenScreenTagList
  26.     move.l    d0,screen
  27.     tst.l    d0
  28.     beq    error
  29.  
  30.     move.l    #640,d0
  31.     move.l    #1,d1
  32.     move.l    #8,d2
  33.     move.l    #BMF_INTERLEAVED|BMF_DISPLAYABLE,d3
  34.     sub.l    a0,a0
  35.     CALLGRAF AllocBitMap
  36.     move.l    d0,bmap
  37.     tst.l    d0
  38.     beq.s    error
  39.  
  40.     lea    tmprp,a1
  41.     CALLGRAF InitRastPort
  42.     lea    tmprp,a1
  43.     move.l    bmap(pc),rp_BitMap(a1)
  44.  
  45.     clr.w    cnt
  46. loop:    bsr    line
  47.     bsr    WPA8
  48.     addq.w    #1,cnt
  49.     cmp.w    #10,cnt
  50.     blt.s    loop
  51.  
  52. error:    move.l    screen(pc),a0
  53.     move.l    a0,d0
  54.     beq.s    .nocl
  55.     CALLINT    CloseScreen
  56. .nocl:
  57.     move.l    bmap(pc),a0
  58.     move.l    a0,d0
  59.     beq.s    .nof
  60.     CALLGRAF FreeBitMap
  61. .nof:
  62.     move.l    oldstack(pc),sp
  63.     moveq    #0,d0
  64.     rts
  65.  
  66. ;------------------------------------------
  67.  
  68. gfxopen:
  69.     lea    gfxname(pc),a1
  70.     moveq    #0,d0
  71.     CALLEXEC OpenLibrary
  72.     move.l    d0,_GfxBase
  73.     tst.l    d0
  74.     beq    error
  75.     rts
  76.  
  77. intuiopen:
  78.     lea    intuiname(pc),a1
  79.     moveq    #39,d0
  80.     CALLEXEC OpenLibrary
  81.     move.l    d0,_IntuitionBase
  82.     tst.l    d0
  83.     beq    error
  84.     rts
  85.     
  86.     dc.b    '$VER: TestWPA8 1.0 (23.8.95) by Pawel Hernik',0
  87.  
  88. intuiname:    INTNAME
  89. gfxname:    GRAFNAME
  90.  
  91.     even
  92. _IntuitionBase    dc.l    0
  93. _GfxBase    dc.l    0
  94. oldstack:    dc.l    0
  95. screen:        dc.l    0
  96. cnt:        dc.w    0
  97. bmap:        dc.l    0
  98. tmprp:        dcb.b    rp_SIZEOF*2
  99.  
  100. screentaglist:
  101.     dc.l    SA_Width,640, SA_Height,480, SA_Depth,8
  102.     dc.l    SA_DisplayID,$8004
  103.     dc.l    SA_Colors32,cols
  104.     dc.l    SA_Quiet,-1
  105.     dc.l    SA_Overscan,0
  106.     dc.l    SA_Interleaved,-1
  107.     dc.l    TAG_END
  108.  
  109. cols:    dc.w    11,0
  110.     dc.l    $00000000,$00000000,$00000000
  111.     dc.l    $ff000000,$ff000000,$ff000000
  112.     dc.l    $00000000,$ff000000,$ff000000
  113.     dc.l    $ff000000,$ff000000,$00000000
  114.     dc.l    $00000000,$ff000000,$00000000
  115.     dc.l    $ff000000,$00000000,$ff000000
  116.     dc.l    $ff000000,$00000000,$00000000
  117.     dc.l    $00000000,$33000000,$ff000000
  118.     dc.l    $ff000000,$7f000000,$00000000
  119.     dc.l    $ff000000,$ff000000,$00000000
  120.     dc.l    $ff000000,$00000000,$7f000000
  121.     dc.l    0
  122.  
  123. ;------------------------------------------
  124.  
  125. line:    lea    chunky,a0
  126.     move.w    cnt(pc),d0
  127.     addq.w    #1,d0
  128.     move.w    d0,d1
  129.     lsl.w    #5,d0
  130.     add.w    d0,a0
  131.     move.w    #480-1,d2
  132. .loop:    move.b    d1,(a0)
  133.     add.w    #640,a0
  134.     dbra    d2,.loop
  135.     rts
  136.     
  137. ;--------------------------------------
  138.  
  139. WPA8:    move.l    screen(pc),a6
  140.     lea    sc_RastPort(a6),a0
  141.     lea    tmprp(pc),a1
  142.     lea    chunky,a2
  143.     moveq    #0,d0
  144.     moveq    #0,d1
  145.     move.w    #639,d2
  146.     move.w    #479,d3
  147.     CALLGRAF WritePixelArray8
  148.     rts
  149.  
  150. ;---------------------------------------------------------
  151.  
  152.     section    chunky,bss
  153. chunky:    ds.l    640*480/4
  154.